<template>
  <a-input v-model:value="val" @change="change" :disabled="isDisabled" />
</template>

<script>
import { ref } from "@vue/reactivity";

export default {
  props: {
    currentVal: {
      //当前选中值
      type: String,
      required: true,
    },
    isDisabled:{//是否禁用
            type:Boolean,
            default:false
        }
  },
  setup(props, { emit }) {
    // 响应式数据
    const val = ref(props.currentVal);

    // 双向绑定数据
    const change = (event) => {
      emit("update:currentVal", event.target.value);
    };

    return {
      val,
      change,
    };
  },
};
</script>

<style>
</style>